<% title "Contributors to #{@user}'s repositories - Libraries.io" %>

<h1>
  <%= image_tag @user.avatar_url(120), width: 60, height: 60, alt: @user %>
  Contributors to <%= link_to @user, user_path(@user.to_param) %>'s repositories
</h1>
<hr>

<div class="row">
  <div class="col-sm-8">
    <% if @contributors.any? %>
      <% @contributors.each do |user| %>
        <% next if user.nil? %>
        <div class="">
          <%= link_to image_tag(user.avatar_url(120), width: 60, height: 60, alt: user), user_path(user.to_param) %>
          <h4>
            <%= link_to user, user_path(user.to_param) %>
            <% if user.name.present? %>
              <small>
                <%= user.login %>
              </small>
            <% end %>
          </h4>
        </div>
      <% end %>
      <%= will_paginate @contributors, page_links: false %>
      <p>
        <small class='text-muted'>
          <%= page_entries_info @contributors, model: 'contributor' %>
        </small>
      </p>
    <% else %>
      <p>
        No contributors found, go back to <%= link_to @user, user_path(@user.to_param) %>.
      </p>
    <% end %>
  </div>
  <div class="col-sm-4">

  </div>
</div>
